package com.yanqu.road.server.cmd.activity.daomu;

import com.yanqu.road.entity.activity.daomu.config.DaoMuActivityConfig;
import com.yanqu.road.entity.enums.eActivityType;
import com.yanqu.road.entity.enums.eLogMoneyType;
import com.yanqu.road.logic.helper.ActivityHelper;
import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.pb.activity.DaoMuProto;
import com.yanqu.road.server.cmd.base.AbstractCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.command.CmdApi;
import com.yanqu.road.server.gameplayer.GamePlayer;
import com.yanqu.road.server.gameplayer.module.activity.daomu.DaoMuActivityModule;
import com.yanqu.road.server.gameplayer.module.player.CurrencyModule;
import com.yanqu.road.server.manger.activity.daomu.DaoMuActivityMgr;
import com.yanqu.road.server.protocol.GameErrorCode;
import com.yanqu.road.server.protocol.Protocol;
import com.yanqu.road.utils.property.Property;
import com.yanqu.road.utils.property.PropertyHelper;

@CmdApi(reqMsg = DaoMuProto.DaoMuPveExploreReqMsg.class, respMsg = DaoMuProto.DaoMuPveExploreRespMsg.class)
@Cmd(code = Protocol.S_DAOMU_EXPLORE,desc = "盗墓笔记-前往探索")
public class DaoMuPveExploreCmd extends AbstractCommand {

    @Override
    public boolean parseData(YanQuMessage packet) throws Exception {
        return true;
    }

    @Override
    public void execute(GamePlayer player, YanQuMessage packet) throws Exception {
        DaoMuProto.DaoMuPveExploreReqMsg reqMsg = DaoMuProto.DaoMuPveExploreReqMsg.parseFrom(packet.getBytes());
        DaoMuProto.DaoMuPveExploreRespMsg.Builder respMsg = player.getModule(DaoMuActivityModule.class).pveExplore(reqMsg);
        player.sendPacket(Protocol.U_DAOMU_EXPLORE, respMsg);
    }

    @Override
    public void sendData(GamePlayer player) {
        if(ret != 0){
            DaoMuProto.DaoMuPveExploreRespMsg.Builder respMsg = DaoMuProto.DaoMuPveExploreRespMsg.newBuilder();
            respMsg.setRet(ret);
            player.sendPacket(Protocol.U_DAOMU_EXPLORE, respMsg);
        }
    }
}
